package com.Enums;

import com.insideClass.Generics.GenericsInterface.Generator;

import java.util.Random;

enum CartoonCharacter implements Generator<CartoonCharacter> {
    SLAAPPY,SPANKY,PUNCHY,SILLY,BOUNCY,NUTTY,BOB;
    private Random rand=new Random(47);
    @Override
    public CartoonCharacter next() {
        return values()[rand.nextInt(values().length)];
    }
}
/**
 * @author 13699
 */
public class EnumImplementation {
    public static <T> void printNext(Generator<T> rg){
        System.out.print(rg.next()+",");
    }

    public static void main(String[] args) {
        CartoonCharacter cc=CartoonCharacter.BOB;
        for (int i = 0; i < 10; i++) {
            printNext(cc);
        }
    }
}
